package com.zx.idc.backend.gui.ins;


import com.baomidou.mybatisplus.plugins.Page;
import com.zx.idc.backend.gui.common.BaseApi;
import com.zx.idc.backend.gui.common.Result;
import com.zx.idc.ds.ins.service.IInsAdminControlService;
import com.zx.idc.ds.ins.vo.InsAdminControlVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 管理控制指令表 前端控制器
 * </p>
 *
 * @author rxliuli
 * @since 2019-01-31
 */
@RestController
@RequestMapping("/api/insAdminControl")
public class InsAdminControlController extends BaseApi {

    @Autowired
    private IInsAdminControlService iInsAdminControlService;

    @GetMapping("/query-page")
    @RequiresPermissions("regulatory-directive:ins-admin-control")
    public Result<Page<InsAdminControlVo>> queryPage(Page<InsAdminControlVo> page, InsAdminControlVo insAdminControlVo) {
        return success(iInsAdminControlService.queryPage(page, insAdminControlVo));
    }

    @PostMapping("/delete/batch")
    @RequiresPermissions("regulatory-directive:ins-admin-control:edit")
    public Result<Boolean> deleteList(@RequestBody List<String> ids) {
        return success(iInsAdminControlService.deleteBatchIds(ids));
    }
}

